home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / B-C / Color Window Demo / ShowOff.Doc < prev    next >
Encoding:
Text File  |  1988-11-22  |  9.1 KB  |  156 lines  |  [TEXT/KAHL]

  1. ==============================================================================
  2. 11/22/88        ABOUT 'SHOWOFF' FOR LIGHTSPEED PASCAL & C
  3. ==============================================================================
  4.  
  5. The files contained in the StuffIt file are the first two training programs
  6. from the book "How To Write Macintosh Software" written by Scott Knaster formerly of Apple. Both a LightSpeed Pascal and LightSpeed C version of the 
  7. programs is provided.  The programs are adapted from the First Edition of the book, which is now out in a Second Edition.  There are few differences between the two editions and these programs should allowing you to do the debugging exercises in chapter 7 of either edition.  If you wish you can compare line-for-line and make any changes necessary.  These programs can also be modified to complete the other exercises in the book, the basc structure follows the ShowOff program.  You will need to follow line-for-line to compare the programs and make appropriate changes.
  8.  
  9. For those of you just starting to program on the Macintosh, I highly recommend
  10. this book.  Scott has done an excellent job of making the Macintosh programming
  11. environment understandable.
  12.  
  13. Believe me when I say that programming an easy to use program for the Mac is much more complex than using the finished product.  
  14.  
  15. The program 'ShowOff' is introduced in chapter 7 of the book, 'Real Live Debugging'.  For those programming in LightSpeed Pascal 'debugging' is sort of an understatement, it can take hours just to get to the point of starting to debug along with the book.
  16.  
  17. The Pascal program 'ShowOff' is written in MPW Pascal, which differs from LightSpeed in several ways, the most obvious being that MPW accepts incompatible 'typing' on a single line of MPW Pascal code.  
  18.  
  19. While this is nice for MPW Macintosh programmers, as the Mac environment forces mixing of types with regular frequency, it can be quite frustrating when MPW source is used with a 'classical' Pascal compiler, in as far as 'typing' is concerned.  LightSpeed is such a complier.
  20.  
  21. The first Pascal program is 'ShowOff 7-1'.  This is the first exercise in debugging a Mac program.  This version is converted to LightSpeed, with all 'bugs' intact so you may happily go 'bug hunting'.  Except as noted in the source code this version is the same as in the book, just converted to LightSpeed.
  22.  
  23. The second Pascal program is 'ShowOff 7-2' this is the debugged version and matches, with the conditions stated above, the book program 'Listing 7-2'
  24.  
  25. Finally, the 'C' program 'ShowOff 7-4' is a 'C' conversion of listing 7-2 written for MPW C.  There were several alterations needed (for MPW differences as well as fixing errors in the First Edition book) to convert to LightSpeed C.
  26. As an added adventure the 'C' program 'Show 7-4 W/Bugs' adds the bugs back into the program just like listing 7-1 in Pascal.  Both of these programs can be used while doing chapter 7's exercises using LightSpeed C.
  27.  
  28.  
  29. ========================================================
  30. === Instructions For Running Under LightSpeed Pascal ===
  31. ========================================================
  32.  
  33. From within the LightSpeed program:  (SUBSTITUTE THE PROGRAM VERSION FOR 'X').
  34.  
  35.   1) Select 'OPEN PROJECT' from the 'PROJECT menu. Open 'ShowOff 7-X.proj'.
  36.   2) This will open the project file with the items:
  37.        MacPasLib
  38.        MacTraps
  39.        ShowOff 7-X.pas
  40.      and the RUN OPTIONS set to use resource file 'ShowOff 7-x.Rsrs
  41.                                                       
  42.   3) Choose the 'RUN OPTIONS' under 'PROJECT' and pick 'use resource file'.
  43.      Pick the resource file 'ShowOff 7-X.Rsrs' for use when compiling}
  44.   4) Select 'GO' and you'll be off and running.
  45.  
  46. That's all there is to getting it to run, have fun.
  47. ========================================================
  48.  
  49.  
  50. ========================================================
  51. === Instructions For Running Under LightSpeed C      ===
  52. ========================================================
  53.  
  54. From within the LightSpeed program:  (SUBSTITUTE THE PROGRAM VERSION FOR 'X').
  55.  
  56.   1) Select 'OPEN PROJECT' from the 'PROJECT menu. Open 'ShowOff 7-X project'.
  57.   2) This will open the project file with the items:
  58.        MacTraps
  59.        ShowOff 7-X.c
  60.        strings
  61.                                                       
  62.   3) The resource file will be automatically included when running based
  63.      on the resource file name NAME project.rsrc
  64.  
  65.   4) Select 'RUN' form the PROJECT menu and you'll be off and running.
  66.  
  67.   5) If you are running under LightSpeed C version 3.xx you can optionally
  68.      use the DEBUGGER feature and may also reduce the compile time by using
  69.      the 'MacHeaders' option and commenting out the '#include "file"' 
  70.      statements at the begining of the program.
  71.  
  72. That's all there is to getting it to run, have fun.
  73. ========================================================
  74.  
  75.  
  76. For those of you who are just learning to program either the Macintosh, LightSpeed Pascal or C, I offer these conversions of SHOWOFF, FREE and in the
  77. PUBLIC DOMAIN to ease your learning curve.  Pass the entire StuffIt file to as
  78. many BBSs as you wish.  This is a small token of gratitude for all the
  79. freeware I've received for the Macintosh.
  80.  
  81. Thanks goes to Larry Rosenstein of Apple for his help in setting me straight
  82. on a couple of subjects during my learning curve on the Mac.
  83.  
  84. =========================== MINI ADVERTISEMENT ========================
  85. Also look for other source code offerings through the ShareWare program.
  86. All source code includes extensive comments (Even I need them to remind
  87. me what I did a week earlier), resource files if used and complete ready to
  88. run projects to open from LightSpeed products. So far all programs are 
  89. suitable for use as application shells. Presently two programs are available:
  90.  
  91. 'Text Convert'- in LightSpeed Pascal and LightSpeed C - A simple application 
  92. to convert text file line endings to be Mac or IBM compatible. A nice shell program with many Mac features ready to modify for your use. This one is nice
  93. for those of you learning LightSpeed 'C' who want some examples of a Pascal
  94. and 'C' program which do the same things.  The 'C' version was converted as
  95. closely as possible directly from the Pascal version..  Having both helps to
  96. understand the conversion of the "Inside Macintosh" calls, which are written
  97. in Pascal.
  98.  
  99. 'IFSv1.xx'- in LightSpeed C - A graphics program for decompressing a graphic
  100. picture stored in 'Iterated Function System' format. Supports original style
  101. 8 color operations (so it runs on Mac Plus, SE and II).  Included are a 
  102. normal Mac verison and a 68881 version to take advantage of the Mac II's
  103. floating point coprocessor to speed up the calculations.
  104.   ** If you are mainly looking for a nice Shell program, this is my latest and
  105.   ** greatest, includes radio and check boxes, static text and edit items
  106.   ** inside a dialog to allow modification of program specific variables or
  107.   ** run time options.
  108.  
  109. Both programs, while being useful and fun applications, are really ment to be
  110. application shells, complete with many Macintosh user interface features of 
  111. interest to many programs. Features include: menus control, multiple
  112. window operations, WindowPicture saving for automatic window information 
  113. upating, growing, zooming, text file loading and saving, DA operation etc.
  114.  
  115. Look for the compiled applications on GEnie, CompuServe and the MacInfo BBS
  116. (415) 795-8862. Either program's source code may also be ordered for a ShareWare registration fee as specified below.  By honoring the ShareWare request for the source code, you will encourge further source code releases.  The fee is modest and helps offset the programming time and connect charges incurred in providing these programs to the Macintosh community.
  117.  
  118.   If you would like to register your ShareWare support and obtain the source
  119.   code of the latest version of either program, please send $5 per program
  120.   (or $7.50 and 2 800K disks for both), a ** 800K ** disk PER PROGRAM and a
  121.   STAMPED self-addressed envelope (strong enough to mail your disk in) along
  122.   with your registration.
  123.  
  124.   PLEASE NOTE: I WILL NOT SEND NEWEST VERSION WITHOUT YOUR DISKS
  125.                AND SELF-ADDRESSED-STAMPED ENVELOPE!
  126.  
  127.   Please specify which program you want, 'Text Convert' will be in
  128.   both LightSpeed Pascal and C while 'IFSv1.xx' is only available in 'C' only.
  129.  
  130.   Remember: If you send $7.50 and 2 800K disks you'll get both programs!!                                            
  131.   Stephen Scandalis
  132.   1414 Prince Edward Way
  133.   Sunnyvale, CA 94087
  134.  
  135. P.S. For those who do not already have it, the source code for the program
  136.      'ShowOff' in LightSpeed Pascal and C is available as FREEWARE, in the 
  137.      Public Domain.  'ShowOff' is a debugging training exercise from the
  138.      book "How To Write Macintosh Software" by Scott Knaster.  You can
  139.      find the complete source code on Genie, CompuServe and on the MacInfo BBS
  140.      (415) 795-8862 or ask for it when you request my other programs.
  141.      
  142. =========================================================================
  143.  
  144. If you have comments, bugs to report etc. about something in the source code
  145. please contact me at the address above or on GEnie or CompuServe (I only go out
  146. every couple of weeks, so it may take awhile to receive an answer)
  147.  
  148. GEnie:         S.SCANDALIS
  149. CompuServe:    70167,2205  STEPHEN A. SCANDALIS
  150.  
  151.  
  152. Have fun,
  153.  
  154. Stephen Scandalis
  155.  
  156.